package com.itwlj.mapper;

import com.github.pagehelper.Page;
import com.itwlj.dto.SpecPageQueryDTO;
import com.itwlj.entity.Spec;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SpecMapper {

    /**
     * 新增规格
     *
     * @param spec
     */
    void insert(Spec spec);

    /**
     * 规格分页查询
     *
     * @param specPageQueryDTO
     * @return
     */
    Page<Spec> pageQuery(SpecPageQueryDTO specPageQueryDTO);

    /**
     * 规格批量删除
     *
     * @param ids
     */
    void deleteBatch(List<Long> ids);

    /**
     * 查询规格
     *
     * @return
     */
    @Select("select * from spec")
    List<Spec> list();

    @Select("select * from spec where id = #{id}")
    Spec getById(Long id);
}
